<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('缴费单列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>缴费单号：</label>
                                <input type="text" name="paymentNo"/>
                            </li>

                            <li>
                                <label>费用类型</label>
                                <select name="paymentCategory" th:with="type=${@dict.getType('sc_payment_category')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>学期：</label>
                                <input type="text" name="term"/>
                            </li>
                            <li class="select-time">
                                <label>缴费时间：</label>
                                <input type="text" class="time-input" id="beginPaymentTime" placeholder="开始时间" name="params[beginPaymentTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endPaymentTime" placeholder="结束时间" name="params[endPaymentTime]"/>
                            </li>
                            <li>
                                <label>缴费方式：</label>
                                <select name="paymentType" th:with="type=${@dict.getType('sc_payment_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>

                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('school:bill:edit')}]];
        var removeFlag = [[${@permission.hasPermi('school:bill:remove')}]];
        var prefix = ctx + "student";
        var paymentCategoryDatas = [[${@dict.getType('sc_payment_category')}]];
        var paymentStatusDatas = [[${@dict.getType('sc_payment_status')}]];
        $(function() {
            var options = {
                url: prefix + "/pay/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "缴费单",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id', 
                    title: 'id',
                    visible: false
                },
                {
                    field: 'userName', 
                    title: '用户名称'
                },
                {
                    field: 'paymentCategory', 
                    title: '费用类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(paymentCategoryDatas, value);
                    }
                },
                {
                    field: 'amount', 
                    title: '费用'
                },
                {
                    field: 'status', 
                    title: '状态',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(paymentStatusDatas, value);
                    }
                },
                {
                    field: 'payDate', 
                    title: '创建时间'
                },
                {
                    field: 'term', 
                    title: '学期'
                },
                {
                    field: 'paymentTime', 
                    title: '缴费时间'
                },
                {
                    field: 'paymentType', 
                    title: '缴费方式'
                },
                {
                    field: 'paymentNo', 
                    title: '缴费单号'
                },
                {
                    field: 'remark', 
                    title: '备注'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>